<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- public quote -->
<%@include file="/jsp/comm_css_include.jsp"%>
<!-- jqgrid-->
<link href="${basePath}/css/plugins/jqgriddemo/css/ui.jqgrid-bootstrap.min.css" rel="stylesheet" />
<!doctype html>
<html>
<head>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		 <div class="iboxtitle">
             <span><i class="glyphicon glyphicon-map-marker"></i>&nbsp;业务受理>业务申请>征信查询情况</span>
         </div>
         
         
         <div class="ibox-content ibox-zxsearchqu ">
			<div class="row">
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<label class="sr-only">客户名：</label>
							<input type="text" placeholder="客户名" id="cusName" name="cusName" class="form-control">
						</div>
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<label class="sr-only">业务员：</label>
							<input type="text" placeholder="业务员" id="salerName" name="salerName" class="form-control">
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="submitTimeStart" name="submitTimeStart"
								placeholder="录入开始时间" class="laydate-icon form-control">
						</div>
						<label class="hxleft">至</label>
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="submitTimeEnd" name="submitTimeEnd" placeholder="录入结束时间"
								class="laydate-icon form-control">
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="shenqingSubmitTimeStart" name="shenqingSubmitTimeStart" placeholder="申请开始时间" class="laydate-icon form-control">
						</div>
						<label class="hxleft">至</label>
						<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
							<input id="shenqingSubmitTimeEnd" name="shenqingSubmitTimeEnd" placeholder="申请结束时间" class="laydate-icon form-control">
						</div>
					</div>
				</div>
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-1">
					<button class="zhixcx" type="button" onclick="query();">执行查询</button>
				</div>
			</div>
		</div>
          
        <div class="ibox-content">	
          	<div class="jqGrid_wrapper">
	             <table id="table_list_1"></table>
	             <div id="pager_list_1"></div>
         	</div>
         </div>  
	</div>
	
	<!-- 业务员-->
	<%@include file="/jsp/ywychoice_js_include.jsp"%>
	
	<!-- public quote -->
    <%@include file="/jsp/comm_js_include.jsp"%>

	<!-- jqGrid -->
    <script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/jquery.jqGrid.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/grid.locale-cn.min.js"></script>	
    
    <!-- layerDate plugin javascript -->
    <script src="${basePath}/js/plugins/layer/laydate/laydate.js"></script>

    <script type="text/javascript">
	    var winWidth = $(window).width();
		var winHeight = $(window).height();
		
		 laydate({
	        elem: '#shenqingSubmitTimeStart', 
	        event: 'focus' 
	    });
    	
	    laydate({
	        elem: '#shenqingSubmitTimeEnd', 
	        event: 'focus' 
	    });
		
	    laydate({
	        elem: '#submitTimeStart', 
	        event: 'focus' 
	    });
    	
	    laydate({
	        elem: '#submitTimeEnd', 
	        event: 'focus' 
	    });
	    
	   
		
	    jQuery(function($) {  
	    	getData();
	    });
	    
	    var getData = function()
	    {
	      var winWidth = $('div.ibox-content').width();
	      var winHeight = document.body.offsetHeight - 300;
	      var win = winWidth / 11 - 10;
  	 	  $.jgrid.defaults.styleUI = 'Bootstrap';
  	 	   
		  jQuery("#table_list_1").jqGrid
		  ({
			url:'${basePath}/YwShenQingZxController/getZxDataResultList',
	        datatype : "json",
	        colNames : [ '主键', '客户姓名','业务员','身份证号码', '角色', '主借人姓名','银行', '征信查询状态', '征信查询申请时间', '征信结果','征信查询操作人','征信查询结果录入时间'],
	        colModel : [ 
	                     {name: 'replaceId', index: '', hidden:true},
	                     {name: 'cusName',index: '',width: win,align: "center", sortable: false},
	                     {name: 'salerName',index: '',width: win,align: "center", sortable: false},
	                  	 {name: 'cusNo',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'creditPeopleType',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'customerName',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'bankCode',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'creditQueryStatus',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'createTime',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'creditResult',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'operatorName',index: '',width: win,align: "center", sortable: false},
	            		 {name: 'modifiedTime',index: '',width: win,align: "center", sortable: false}
	            		 
	                   ],
              mtype : "post",
              height: winHeight,
              width:winWidth,  
              shrinkToFit:false,
              autoScroll: false,
              rowNum: 15,
              rowList: [15, 30, 45],
              viewrecords: true,
              pager: "#pager_list_1",
              hidegrid: false,
              multiselect : false,
              altRows:true,
              altclass:'someClass',
              ondblClickRow:function(rowId)
              {
            	  var row = $("#table_list_1").jqGrid("getRowData",rowId);
              },
              jsonReader : {
            	  root:"result.rows",
            	  page: "result.page",
            	  total: "result.total",
            	  records: "result.records",
            	  repeatitems: false,
            	  id: "replaceId"
              },
              loadComplete:function(datas){
             	  if (datas.flag == "100100") {
                       layer.msg("查询成功!", {icon: 6, time: 1000});
                       return;
                   }
             	 if(datas.flag == '100802') {
    				  top.location.href = thisLoginUrl;
    				  return;
    			  }

             	  layer.msg(datas.message, {icon: 2});
               }
	      });
	    }	    
	    
	    window.onresize = function()
	    {
	    	$("#table_list_1").setGridWidth($(window).width()-80);
	    }
	    
	    var query = function(){
	    	var postData = $("#table_list_1").jqGrid("getGridParam", "postData");
	    	var data = {};
	    	data.cusName = document.getElementById('cusName').value || '';
	    	data.salerName = document.getElementById('salerName').value || '';
	    	data.submitTimeStart = document.getElementById('submitTimeStart').value || '';
	    	data.submitTimeEnd = document.getElementById('submitTimeEnd').value || '';
	    	data.shenqingSubmitTimeStart = document.getElementById('shenqingSubmitTimeStart').value || '';
	    	data.shenqingSubmitTimeEnd = document.getElementById('shenqingSubmitTimeEnd').value || '';
	    	$.extend(postData, data);
	    	refresh();
	    }
	    
	    var refresh = function()
	    {
	    	$("#table_list_1").jqGrid("setGridParam", { search: true }).trigger("reloadGrid", [{ page: 1}]);
	    }
	</script>
</body>
</html>
